import './assets/main.css'


import {createApp} from 'vue'
import {createPinia} from 'pinia'

import App from './App.vue'
import router from './router'


import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn'

import {useDirc} from '@/utils/use_direc.js'
// 如果您正在使用CDN引入，请删除下面一行。
import * as ElementPlusIconsVue from '@element-plus/icons-vue'


const app = createApp(App)

//注册指令
useDirc(app)


//注册
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}




app.use(ElementPlus, {
    size: 'small',
    locale: zhCn,
})
// 在main.js中添加
app.config.errorHandler = (err, vm, info) => {
    console.error(`全局捕获错误: ${err.toString()}\n信息: ${info}`)
    // 可以在这里统一显示错误提示
}

app.use(createPinia())
app.use(router)

app.mount('#app')









